package com.aiyige.base.api.service;

import com.aiyige.base.api.ApiUrls;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.DELETE;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface TokenService {
    @POST(ApiUrls.oauth2GetGuestToken)
    @Headers("Content-Type: application/json")
    Call<ResponseBody> getGuestToken(@Header("Authorization") String authorization, @Query("grant_type") String grantType);

    @POST(ApiUrls.oauth2RefreshToken)
    @Headers("Content-Type: application/x-www-form-urlencoded")
    Call<ResponseBody> refreshToken(@Header("Authorization") String authorization, @Query("grant_type") String grantType, @Query("refresh_token") String refreshToken);

    @DELETE(ApiUrls.oauth2Logout)
    Call<ResponseBody> oauth2Logout(@Header("Authorization") String authorization, @Header("clientInfo") String clientInfo, @Query("access_token") String accessToken);
}
